package com.github.chirspan.xaas.rbac.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.chirspan.xaas.rbac.model.RbacResource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * ************************
 * <p></p>
 * *************************
 *
 * @author chenpan
 * @date 2021/1/19 15:02
 */
@Mapper
public interface RbacResourceDao extends BaseMapper<RbacResource> {

    List<RbacResource> findResourcesByRole(@Param("roleCode") String roleCode, @Param("type") String type);

    List<RbacResource> findUserPermissions(String username);

    List<RbacResource> findResources(RbacResource resource);

    List<RbacResource> findUserMenus(@Param("username") String username, @Param("appIds") List<String> appIds);
}
